accumulate <- function(n){
  result <- 0
  for(i in 1:n){
    result <- result+i
  }
  return(result)
}
print(accumulate(10))
